load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rac2",
    srcs = [
        "priority.go",
        "range_controller.go",
        "store_stream.go",
        "token_counter.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol/rac2",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/kv/kvserver/kvflowcontrol",
        "//pkg/raft/raftpb",
        "//pkg/raft/tracker",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/buildutil",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "rac2_test",
    srcs = [
        "priority_test.go",
        "range_controller_test.go",
        "token_counter_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":rac2"],
    deps = [
        "//pkg/kv/kvserver/kvflowcontrol",
        "//pkg/raft/raftpb",
        "//pkg/raft/tracker",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/humanizeutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_dustin_go_humanize//:go-humanize",
        "@com_github_stretchr_testify//require",
    ],
)
